import VueRouter from 'vue-router'


// 导入对应的路由组件
import HomeContainer from './components/tabbar/HomeContainer.vue'
import MemberContainer from './components/tabbar/MemberContainer.vue'
import ShopcarContainer from './components/tabbar/ShopcarContainer.vue'
import SearchContainer from './components/tabbar/SearchContainer.vue'
import NewList from './components/news/NewList.vue'
import NewInfo from './components/news/NewInfo.vue'
import PhotoList from './components/photos/PhotoList.vue'
import PhotoInfo from './components/photos/PhotoInfo.vue'
import goodsList from './components/goods/goodsList.vue'
import goodsInfo from './components/goods/goodsInfo.vue'
import goodsDesc from './components/goods/goodsDesc.vue'
import goodsComment from './components/goods/goodsComment.vue'
import Message from './components/Message/Message.vue'


// 3. 创建路由对象
var router = new VueRouter({
  routes: [ //匹配路由规则的
    {path:'',redirect:'/home'},
    {path:'/home',component:HomeContainer},
    {path:'/member',component:MemberContainer},
    {path:'/shopcar',component:ShopcarContainer},
    {path:'/search',component:SearchContainer},
    {path:'/home/NewList',component:NewList},
    {path:'/home/NewInfo/:id',component:NewInfo},
    {path:'/home/photolist',component:PhotoList},
    {path:'/home/PhotoInfo/:id',component:PhotoInfo},
    {path:'/home/goodsList',component:goodsList},
    {path:'/home/goodsInfo/:id',component:goodsInfo,name:'goodsinfo'},
    {path:'/home/goodsDesc/:id',component:goodsDesc,name:'goodsDesc'},
    {path:'/home/goodsComment/:id',component:goodsComment,name:'goodsComment'},
    {path:'/home/message',component:Message}
  ],
  linkActiveClass: 'mui-active'  //默认覆盖路由高亮的类，默认的类叫做router-link-active
})

// 把路由对象暴露出去
export default router